#{extends 'CRUD/layout.html' /}
#{set title:messages.get('crud.list.title', type.name) /}

<div id="crudList" class="${type.name}">

    <h2 id="crudListTitle">&{'crud.list.title', type.name}</h2>

    <div id="crudListSearch">
        #{crud.search /}
    </div>

    <div id="crudListTable">
        #{crud.table fields:['title', 'episode', 'air_date', 'season', 'serie']}
		   #{crud.custom 'title'}
		      <a href="@{AdminEpisodes.show(object.id)}">${object.title}</a>
		   #{/crud.custom}
		   #{crud.custom 'episode'}
		      ${object.episode}
		   #{/crud.custom}
		   #{crud.custom 'air_date'}
		      ${object.air_date}
		   #{/crud.custom}
		   #{crud.custom 'season'}
		      ${object.season}
		   #{/crud.custom}
		   #{crud.custom 'serie'}
		      ${object.serie.name}
		   #{/crud.custom}
        #{/crud.table}
    </div>

    <div id="crudListPagination">
        #{crud.pagination /}
    </div>

    <p id="crudListAdd">
        <a href="@{blank()}">&{'crud.add', type.modelName}</a>
    </p>

</div>
